package com.lbssoft.gpsbd;

import com.lbssoft.datalink.util.Log;
import com.lbssoft.gpsbd.controller.WebSocket;
import com.lbssoft.gpsbd.datalink.DataManager;
import com.lbssoft.gpsbd.datalink.Server;
import com.lbssoft.gpsbd.task.ScheduledTask;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.PropertySource;

import javax.annotation.PostConstruct;

//此注解等价于以默认属性使用@Configuration，@EnableAutoConfiguration和@ComponentScan
@SpringBootApplication
@PropertySource(value={"file:application.properties"})//外部资源
@EnableCaching
public class Application{
    public static void main(String[] args){
    	final ApplicationContext applicationContext = SpringApplication.run(Application.class,args);
        DataManager.setApplicationContext(applicationContext);
		ScheduledTask.setApplicationContext(applicationContext);
        WebSocket.setApplicationContext(applicationContext);
        Server.Start(applicationContext);

	}

	@PostConstruct
	public void logTest() {
	}
}